import http from '@/utils/httpRequest'
import request from '@/utils/httpRequest'

export default {
    // 查询酒店列表
    getHotelList(current,limit,searchObj) {
      return request ({
        url: http.adornUrl(`/hotel/hotel/${current}/${limit}`),
        method: 'post',
        data: http.adornData(searchObj,false)  
      })
    },

    // 根据 dictCode 查询下级数据字典
    findByDictCode(dictCode) {
      return request({
          url:http.adornUrl(`/data/dict/findByDictCode/${dictCode}`),
          method: 'get'
        })
      },
    
    // 根据id查询下级数据字典
    findByParentId(dictCode) {
      return request({
          url: http.adornUrl(`/data/dict/findChildData/${dictCode}`),
          method: 'get'
        })
    },
    // 更新状态
    updateStatus(id, status) {
            return request({
            url: http.adornUrl(`/hotel/hotel/updateStatus/${id}/${status}`),
            method: 'get'
        })
    },
    // 查看酒店详情
    getHotelById(id) {
        return request ({
            url: http.adornUrl(`/hotel/hotel/show/${id}`),
            method: 'get'
        })
    },
    // 添加酒店详情
    add(obj) {
      return request ({
          url: http.adornUrl(`/hotel/hotel/add`),
          method: 'Post',
          data:http.adornData(obj,false,'json') 
      })
  },
  
  }
  